#include"bmpheader.h"
#include"bmpfunc.h"
// -测试头部结构体是否为54字节
void test_bmpheader(){

    unsigned long size = sizeof(BMP_Header);
    if(56 == size){

        printf("no equal.\n");
    }
    printf("sizeof(BMP_Header) = %ld byte.\n",sizeof(BMP_Header));
}

// -open bmp file test
void test_bmpfile(const char * filename){

    BMP_Image * img = BMP_open(filename);
    if(NULL == img){

        printf("read file failed.\n");
        return;
    }
    // BMP_order(img,1);
    // BMP_color_mirror(img);
    BMP_equalize(img);
    BMP_destroy(img);
}

int main(int argc,char * argv[]){

    // test_bmpheader();
    test_bmpfile(argv[1]);
    return EXIT_SUCCESS;
}